module.exports = ({
  router,
  controller
}) => {

  //上传文件
  router.post('/upload/', controller.file.upload);
  //登录
  router.post('/user/login', controller.user.login);
  //注册
  router.post('/user/register', controller.user.register)
  //退出登录
  router.post('/user/logout', controller.user.logout)

  //修改用户基本信息(性别,昵称,头像)
  router.post('/user/update', controller.user.update);

  //修改用户密码
  router.post('/user/password', controller.user.updatePassword);
  //用户收藏文章
  router.post('/user/collect', controller.userArticle.collectArticle);

  //通过Id查询用户
  router.get('/user/:id', controller.user.getById);
    //通过用户id查询收藏文章列表
    router.get('/user/col/:id', controller.userArticle.getCollectArticle);

  //查询书籍信息
  router.get('/book/list', controller.book.list);
  //添加书籍
  router.post('/book/add', controller.book.addBook);
  //通过Id查询书籍
  router.get('/book/:bookId', controller.book.selectById);

  //通过bookId查询书籍详情
  router.get('/book/detail/:bookId', controller.book.listDetail);

  //查询文章分页
  router.get('/article/list', controller.article.list);
  //添加文章
  router.post('/article/add', controller.article.addArticle);
  //通过articleId查询文章
  router.get('/article/:articleId', controller.article.selectById);

  //随机返回小知识
  router.get('/tips/random', controller.tips.random);

   //添加小知识
   router.get('/tips/add', controller.tips.addTips);

  // 通过关键字搜索
  router.get('/search/:keyword', controller.search.select);

  //随机返回指定数量的题目
  router.get('/match/:size', controller.match.random);

};

